package com.sds.sweng.swat.miplatform.ui.design.policies;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.ComponentEditPolicy;
import org.eclipse.gef.requests.GroupRequest;

import com.sds.sweng.swat.miplatform.ui.design.models.MiplatformComponent;
import com.sds.sweng.swat.miplatform.ui.design.models.MiplatformContainer;
import com.sds.sweng.swat.miplatform.ui.design.models.commands.DeleteCommand;

public class DesignComponentEditPolicy extends ComponentEditPolicy {

	protected Command createDeleteCommand(GroupRequest deleteRequest) {
		MiplatformContainer parent = (MiplatformContainer)(getHost().getParent().getModel());
		DeleteCommand deleteCmd = new DeleteCommand(parent, (MiplatformComponent) getHost().getModel());
		return deleteCmd;
	}

}
